package com.siloam.module;
/**
 * 小组成员
 * @author rzpeng
 *
 */
public class GroupUser {
	
	/**
	 * 小组成员的类型:组长
	 */
	public static final int TYPE_LEADER = 1;
	
	/**
	 * 小组成员的类型:普通成员
	 */
	public static final int TYPE_MEMBER = 2;
	
	private int id;
	private int type = 2;
	
	private User user;
	private Group group;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Group getGroup() {
		return group;
	}
	public void setGroup(Group group) {
		this.group = group;
	}
	
	public boolean isLeader(){
		if(type == TYPE_LEADER){
			return true;
		}
		return false;
	}
	
	public boolean isMember(){
		if(type == TYPE_MEMBER){
			return true;
		}
		return false;
	}
	
	public String getTypeText(){
		if(type == TYPE_LEADER){
			return "组长";
		} else if(type == TYPE_MEMBER){
			return "组员";
		}
		return "";
	}
	
}
